import { request } from "@/utils/request";

export default class Index {
    // 菜单
    static getMenus(query) {
        return request({
            url: "/admin-v3/menu/userMenu?language=zh_CN",
            method: "get",
            params: query,
        });
    }
    //首页提示
    static stockAlert() {
        return request({
            url: "/adient-pms/pc/toolList/stockAlert",
            method: "get",
        });
    }

    // 领用/归还/入库 列表
    static getList(query) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/listForPad",
            method: "get",
            params: query,
        });
    }

    // 领用/归还/入库 扫码 列表
    static getAllByIoNo(no) {
        return request({
            url: "/adient-pms/pc/toolIoDetail/getAllByIoNo/" + no,
            method: "get",
        });
    }

    // 领用扫码 提交
    static confirmClaim(query) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/confirmClaim",
            method: "PUT",
            params: query,
        });
    }

    // 归还扫码 提交
    static confirmReturn(query) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/confirmReturn",
            method: "PUT",
            params: query,
        });
    }

    // 入库扫码 提交
    static confirmIn(query) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/confirmIn",
            method: "PUT",
            params: query,
        });
    }

    // 盘点 列表
    static getListInventory(query) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryRecord/listForPad",
            method: "get",
            params: query,
        });
    }
    // 盘点扫码 列表
    static getAllByIoNoInventory(query) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryItem/listByRecordNo",
            method: "get",
            params: query,
        });
    }
    // 盘点扫码 提交
    static confirmInventory(query) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryRecord/padCommit",
            method: "PUT",
            params: query,
        });
    }

    // 快速领用 扫码信息
    static loadByToolCode(params) {
        return request({
            url: "/adient-pms/pc/toolList/loadByToolCode",
            method: "get",
            params,
        });
    }

    // 快速领用 设备列表
    static listByNoPage() {
        return request({
            url: "/adient-pms/pc/deviceInfo/listByNoPage",
            method: "get",
        });
    }

    // 快速领用 提交
    static addClaim(params) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/addClaim",
            method: "post",
            params,
        });
    }

    // 快速领用 提交 pc
    static confirmClaimToPc(params) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/confirmClaimToPc",
            method: "put",
            params,
        });
    }

    //快速入库 扫码信息
    static quickin(params) {
        return request({
            url: "/adient-pms/pc/toolList/loadByToolCode",
            method: "get",
            params,
        });
    }
    // 快速入库 提交
    static fastAdd(params) {
        return request({
            url: "/adient-pms/pc/toolList/fastAdd",
            method: "post",
            params,
        });
    }
    //扫码盘点返回信息
    static getByRecordNoAndToolCode(params) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryItem/getByRecordNoAndToolCode",
            method: "get",
            params,
        });
    }
    //获取厂商名称
    static workShop() {
        return request({
            url: "/adient-pms/pc/base/workShop/list",
            method: "get",
        });
    }

    static fetchWarehouseList(params) {
        return request({
            url: "/adient-pms/pc/warehouse/list",
            method: "get",
            params,
        });
    }
    //设备编号
    static listByWarehouseNo(no) {
        return request({
            url: "/adient-pms/pc/warehouseLocation/listByWarehouseNo/" + no,
            method: "get",
        });
    }
    //设备编号
    static getDeviceList(query) {
        return request({
            url: "/adient-pms/pc/deviceInfo/getDeviceList",
            method: "get",
            params: query,
        });
    }

    //快速查询
    static searchByParam(query) {
        return request({
            url: "/adient-pms/pc/toolList/searchByParam",
            method: "get",
            params: query,
        });
    }

    //备件归还 修改
    static addReturn(query) {
        return request({
            url: "/adient-pms/pc/toolIoRecord/addReturn",
            method: "post",
            params: query,
        });
    }

    //备件盘点 缓存
    static listSparepartInventoryPad(query) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryItem/listSparepartInventoryPad",
            method: "get",
            params: query,
        });
    }

    //盘库校验
    static checkComplet(query) {
        return request({
            url: "/adient-pms/pc/sparepartInventoryRecord/checkComplete",
            method: "get",
            params: query,
        });
    }

        //盘点总数
        static getInventoryNumber(query) {
          return request({
              url: "/adient-pms/pc//sparepartInventoryRecord/getInventoryNumber",
              method: "get",
              params: query,
          });
      }
  
    
}
